<template>
  <div>

    <ul>
      <li v-for='i in list'>{{ i.name }}</li>
    </ul>
    <pages :total='total' @currentP='getCurrent'/>
  </div>
</template>
<script>
import pages from './pages'

export default {
  components: {
    'pages': pages
  },
  data() {
    return {
      list: [],
      total: 0,
      page: 1
    }
  },
  methods: {
    getlist() {
      this.axios.get('pagecates?page=' + this.page).then(res => {
        this.list = res.data.list
        this.total = res.data.total
      })
    },
    getCurrent(v) {
      this.page = v
      this.getlist()
    }
  },
  mounted() {
    this.getlist()
  },
}
</script>
<style lang="">

</style>
